home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWResour / Sources / FWResFil.cpp < prev    next >
Encoding:
Text File  |  1996-04-25  |  5.1 KB  |  195 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWResFil.cpp
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWOS.hpp"
  11.  
  12. #ifndef   FWRESFIL_H
  13. #include "FWResFil.h"
  14. #endif
  15.  
  16. #ifndef   FWSTRS_H
  17. #include "FWStrs.h"
  18. #endif
  19.  
  20. #ifndef   FWFILESP_H
  21. #include "FWFileSp.h"
  22. #endif
  23.  
  24. #ifndef FWEXCDEF_H
  25. #include "FWExcDef.h"
  26. #endif
  27.  
  28. #ifndef   FWPRIDEB_H
  29. #include "FWPriDeb.h"
  30. #endif
  31.  
  32. #ifndef FWEXCEPT_H
  33. #include "FWExcept.h"
  34. #endif
  35.  
  36. //----------------------------------------------------------------------------------------
  37. // Mac-only
  38. //----------------------------------------------------------------------------------------
  39. #ifdef FW_BUILD_MAC
  40.  
  41. #ifndef __ERRORS__
  42. #include <errors.h>
  43. #endif
  44.  
  45. #ifndef __TOOLUTILS__
  46. #include <ToolUtils.h>
  47. #endif
  48.  
  49. #ifndef __RESOURCES__
  50. #include <Resources.h>
  51. #endif
  52.  
  53. #ifndef __MENUS__
  54. #include <Menus.h>
  55. #endif
  56.  
  57. #ifndef __STRING__
  58. #include <string.h>
  59. #endif
  60.  
  61. #ifndef __MEMORY__
  62. #include <Memory.h>
  63. #endif
  64.  
  65. #endif
  66.  
  67. #ifdef FW_BUILD_MAC
  68. #pragma segment fwresour
  69. #endif
  70.  
  71. #if defined(__MWERKS__) && GENERATING68K
  72. // A hack to work around a bug
  73. #pragma import list somNewObjectInstance
  74. #endif
  75.  
  76. //========================================================================================
  77. //    Template instantiations
  78. //========================================================================================
  79.  
  80. #include "FWSOMPtr.tpp"
  81.  
  82. FW_DEFINE_AUTO_TEMPLATE(FW_TCountedSOMPtr, FW_OResourceFile)
  83.  
  84. #if FW_USE_TEMPLATE_PRAGMAS
  85. #pragma template_access public
  86. #pragma template FW_TCountedSOMPtr<FW_OResourceFile>
  87. #endif
  88.  
  89. #if FW_ANSI_TEMPLATE_INTANTIATION
  90. template class FW_TCountedSOMPtr<FW_OResourceFile>;
  91. #endif
  92.  
  93. //========================================================================================
  94. // CLASS FW_PResourceFile
  95. //========================================================================================
  96.  
  97. FW_DEFINE_AUTO(FW_PResourceFile)
  98.  
  99. //----------------------------------------------------------------------------------------
  100. // FW_PResourceFile::FW_PResourceFile 
  101. //----------------------------------------------------------------------------------------
  102.  
  103. FW_PResourceFile::FW_PResourceFile()
  104. {
  105.     FW_END_CONSTRUCTOR
  106. }
  107.  
  108. //----------------------------------------------------------------------------------------
  109. // FW_PResourceFile::FW_PResourceFile 
  110. //----------------------------------------------------------------------------------------
  111.  
  112. FW_PResourceFile::FW_PResourceFile(Environment* ev, FW_OResourceFile *rep)
  113. {
  114.     SetRep(ev, rep);
  115.     FW_END_CONSTRUCTOR
  116. }
  117.  
  118. //----------------------------------------------------------------------------------------
  119. // FW_PResourceFile::FW_PResourceFile 
  120. //----------------------------------------------------------------------------------------
  121.  
  122. FW_PResourceFile::FW_PResourceFile(Environment* ev, FW_OFileSpecification* newFileSpec)
  123. {
  124.     FW_OResourceFile* rep = new FW_OResourceFile();
  125.  
  126.     SetRep(ev, rep);
  127.     rep->InitFromFileSpec(ev, newFileSpec);
  128.     FW_END_CONSTRUCTOR
  129. }
  130.  
  131. //----------------------------------------------------------------------------------------
  132. // FW_PResourceFile::FW_PResourceFile 
  133. //----------------------------------------------------------------------------------------
  134.  
  135. FW_PResourceFile::FW_PResourceFile(Environment* ev, FW_ResourceFileID resFileID)
  136. {
  137.     FW_OResourceFile* rep = new FW_OResourceFile();
  138.  
  139.     SetRep(ev, rep);
  140.     rep->InitFromResFileID(ev, resFileID);
  141.     FW_END_CONSTRUCTOR
  142. }
  143.  
  144. //----------------------------------------------------------------------------------------
  145. // FW_PResourceFile::FW_PResourceFile 
  146. //----------------------------------------------------------------------------------------
  147.  
  148. FW_PResourceFile::FW_PResourceFile(const FW_PResourceFile& other)
  149. {
  150.     FW_SOMEnvironment ev;
  151.  
  152.     SetRep(ev, other);
  153.     FW_END_CONSTRUCTOR
  154. }
  155.  
  156. //----------------------------------------------------------------------------------------
  157. // FW_PResourceFile::~FW_PResourceFile 
  158. //----------------------------------------------------------------------------------------
  159.  
  160. FW_PResourceFile::~FW_PResourceFile()
  161. {
  162.     FW_START_DESTRUCTOR
  163. }
  164.  
  165.  
  166. //========================================================================================
  167. // FW_CMacResLoadFalse
  168. //========================================================================================
  169.  
  170. #if defined FW_BUILD_MAC
  171. FW_DEFINE_AUTO(FW_CMacResLoadFalse)
  172. #endif
  173.  
  174. //----------------------------------------------------------------------------------------
  175. // FW_CMacResLoadFalse::FW_CMacResLoadFalse 
  176. //----------------------------------------------------------------------------------------
  177. #if defined FW_BUILD_MAC
  178. FW_CMacResLoadFalse::FW_CMacResLoadFalse()
  179. {
  180.     ::SetResLoad(false);
  181.     FW_END_CONSTRUCTOR
  182. }
  183. #endif
  184.  
  185. //----------------------------------------------------------------------------------------
  186. // FW_CMacResLoadFalse::~FW_CMacResLoadFalse 
  187. //----------------------------------------------------------------------------------------
  188. #if defined FW_BUILD_MAC
  189. FW_CMacResLoadFalse::~FW_CMacResLoadFalse()
  190. {
  191.     FW_START_DESTRUCTOR
  192.     ::SetResLoad(true);
  193. }
  194. #endif
  195.